package com.unicom.office.node;

import com.unicom.office.func.FuncCommon;
import com.unicom.office.type.TypeItem;
import com.unicom.office.type.WorkbookTypeItem;
import com.unicom.office.type.WorksheetTypeItem;
import com.unicom.office.func.FuncBase;
import com.unicom.office.unit.OfficeUnit;
import com.unicom.office.unit.WorkbookUnit;

public class WorkbookNode extends RootNode {
    public WorkbookNode(Object source) {
        super(source);
    }

    public OfficeUnit createUnit() {
        return new WorkbookUnit();
    }

    public boolean testChildType(FuncCommon child) {
        return child.getType() == WorksheetTypeItem.INSTANCE;
    }

    public OfficeNode clone() {
        return null;
    }

    public boolean testChildType(OfficeNode child) {
        return child instanceof WorksheetNode;
    }

    public TypeItem getType() {
        return WorkbookTypeItem.INSTANCE;
    }
}
